#ifndef MAINDIALOG_H
#define MAINDIALOG_H

#include <QDialog>
#include <QSerialPort>

QT_BEGIN_NAMESPACE
namespace Ui { class mainDialog; }
QT_END_NAMESPACE

class mainDialog : public QDialog
{
    Q_OBJECT

public:
    mainDialog(QWidget *parent = nullptr);
    ~mainDialog();

private slots:
    void recvData();

    void on_btnOpen_clicked();

    void on_btnBeepCtl_clicked();

    void on_btnLED2Ctl_clicked();

    void on_btnLED3Ctl_clicked();

    void on_btnLED4Ctl_clicked();

    void on_sliderLED1_valueChanged(int value);

    void on_sliderServo_valueChanged(int value);

private:

    #pragma pack(push, 1)
    struct DevicerCtlCmd
    {
        quint16 head;
        quint16 devType;
        quint16 devID;
        quint16 devCmd;
        quint16 devCmdArg;
        quint16 tail;
    } devCmd;
    #pragma pack(pop)

    Ui::mainDialog *ui;

    QSerialPort* m_sp;
};
#endif // MAINDIALOG_H
